package org.jeecg.common.modules.register.service;

import org.jeecg.common.modules.register.entity.RegisterPayOrder;
import com.baomidou.mybatisplus.extension.service.IService;
import org.jeecg.common.modules.order.entity.PayOrder;
import org.jeecg.common.util.enums.OrderTypeEnum;

/**
 * @Description: register_pay_order
 * @Author: jeecg-boot
 * @Date:   2021-01-28
 * @Version: V1.0
 */
public interface IRegisterPayOrderService extends IService<RegisterPayOrder> {

    /**
     * 根据openid和挂号记录id获取患者是否有未完成的订单
     */
    boolean checkDoing(String openid,String recordId);

    /**
     * 创建一个支付订单
     * @param doctorId
     * @param wxUserinfoId
     * @param amount
     * @param orderType
     * @return
     */
    RegisterPayOrder initPayOrder(String doctorId, String relationId, String wxUserinfoId, Long amount, OrderTypeEnum orderType, String registerRecordId);

    RegisterPayOrder initPayOrder(String doctorId, String relationId, String wxUserinfoId, Long amount, OrderTypeEnum orderType, String registerRecordId, String patientId);

    RegisterPayOrder initPayOrder(String doctorId, String relationId, String wxUserinfoId, Long amount, OrderTypeEnum orderType, String registerRecordId, String patientId, String isShebao);

    /**
     * 根据订单号获取订单信息
     * @param orderCode
     * @return
     */
    RegisterPayOrder getByOrderCode(String orderCode);


    RegisterPayOrder getByRelationId(RegisterPayOrder registerPayOrder);
}
